#!/bin/bash

vPeerOrgConfigs=""
vConsortium=""
vChannelID=""
vClusterDomain=""
vBaseDir="./"
vNamespace=""
vBatchTimeout="2s"
vMaxMsgCount=10
vAbsMaxBytes="99 MB"
vPreferedMaxBytes="512 KB"
vAction=""

#while [ $# -ge 1 ]; do
#    args=$1
#    key=$(echo $args | awk -F'=' '{print $1}')
#    value=$(echo $args | awk -F'=' '{print $2}')
#    case "$key" in
#        create) vAction=$key; shift 1;;
#        join) vAction=$key; shift 1;;
#        init) vAction=$key; shift 1;;
##        --id) vChannelID=$value; shift 1;;
##        --peerorgs) vPeerOrgConfigs=$value; shift 1;;
##        --consortium) vConsortium=$value; shift 1;;
##        --home) vBaseDir=$value; shift 1;;
##        --cluster.domain) vClusterDomain=$value; shift 1;;
##        --namespace) vNamespace=$value; shift 1;;
##        --channel.batchTimeout) vBatchTimeout=$value; shift 1;;
##        --channel.maxMsgCount) vMaxMsgCount=$value; shift 1;;
##        --channel.absMaxBytes) vAbsMaxBytes=$value; shift 1;;
##        --channel.preferedMaxBytes) vPreferedMaxBytes=$value; shift 1;;
##        --debug) Fcn_SetLogLevel "debug"; shift 1;;
##        *) echo "invalid args:$1"; exit 1;;
#    esac
#done

vAction=$1

if [[ $vAction == "create" ]]; then
    echo "create action "
    echo "channelid: $vChannelID"
fi

if [[ $vAction == "join" ]]; then
    echo "join channel action"
    echo "channelid: $vChannelID"
fi

if [[ $vAction == "init" ]]; then
    echo "init channel service"
fi